    
<? 
require_once 'includes/funciones.php';
include ("seguridad.php");
conexion();
?>
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulo();?></title>
        <link type="text/css"  href="plugins/jq_ui/css/custom-theme/jquery-ui-1.8.14.custom.css" rel="stylesheet"/> 
        <link rel="stylesheet" href="2col_rightNav.css" type="text/css" />
	<link rel="stylesheet" href="plugins/thickbox/thickbox.css" type="text/css" media="screen">
	<script src="plugins/jq_ui/js/jquery-1.4.4.min.js"></script>
	<script  src="plugins/jq_ui/development-bundle/external/jquery.bgiframe-2.1.2.js"></script>
	<script  src="plugins/jq_ui/development-bundle/ui/jquery.ui.core.js"></script>
	<script  src="plugins/jq_ui/development-bundle/ui/jquery.ui.widget.js"></script>
	<script  src="plugins/jq_ui/development-bundle/ui/jquery.ui.mouse.js"></script>
	<script src="plugins/jq_ui/development-bundle/ui/jquery.ui.button.js"></script>
	<script src="plugins/jq_ui/development-bundle/ui/jquery.ui.draggable.js"></script>
	<script src="plugins/jq_ui/development-bundle/ui/jquery.ui.position.js"></script>
	<script src="plugins/jq_ui/development-bundle/ui/jquery.ui.resizable.js"></script>
	<script src="plugins/jq_ui/development-bundle/ui/jquery.ui.dialog.js"></script>
	<script>
	$(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#ver-org" )
			.button()
			.click(function() {
				$( "#dialog-message-org" ).dialog( "open" );
			});
	
		$( "#dialog-message-org" ).dialog({
			modal: true,
                        autoOpen: false,
			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}
		});
	});
	</script>
        
        <script>
	$(function() {
		// a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore!
		$( "#ver-area" )
			.button()
			.click(function() {
				$( "#dialog-message-area" ).dialog( "open" );
			});
	
		$( "#dialog-message-area" ).dialog({
			modal: true,
                        autoOpen: false,
			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}
		});
	});
	</script>


</head>
<!-- The structure of this file is exactly the same as 2col_leftNav.html;
     the only difference between the two is the stylesheet they use -->

<body>
<div   class="supercontendeor">
 <div id="encabezado">
   	<?php
	require_once("encabezado.php");

	?> 
</div>
<!-- fin encabesado -->
<?php
if(isset($_GET['var'])){
  $var=sqlint($_GET['var']);
  if(($_GET['m'])==1){
      $m= mysql_query("select m.id, m.mensaje as men from samptyt.mensajes as m WHERE m.id_capa=$var ORDER BY  m.id desc limit 1");  
      while($row=mysql_fetch_array($m)){
      $mensaje=$row['men'];
      //echo $mensaje;
      }
      
   }
    

$result=mysql_query("select  
  c.id,
  c.titulo,
  c.descripcionautor,
  c.comentariowm,
  c.metadatos, 
  c.tipo,c.tipo,
  c.subtipo,
  cat1.nombre as c1, 
  cat2.nombre as c2,
  p.nombre as pa,
  prov.nombre as pro,
  r.nombre as reg,
  dpto.nombre as de,
  m.nombre as mu,
  o.nombre as org, 
  o.id as oid ,
  c.`area-id`as aid ,
  c.autor,
  c.`fecha-up`,
  c.`usuario-id`,
  c.folder,
  c.imagen,
  c.`file` as f,
  c.verificado,
        c.habilitacion as h 
 from 
  samptyt.capas as c,
  samptyt.categoria1 as cat1,
  samptyt.categoria2 as cat2,
  samptyt.pais as p,
  samptyt.provincia as prov,
  samptyt.region as r,
  samptyt.departamento as dpto,
  samptyt.municipio as m,
  samptyt.organizacion  as o,
  samptyt.area as a 
where  
 c.cat1=cat1.id and
 c.cat2= cat2.id and
 c.`pais-id`=p.id and
 c.`porv-id`=prov.id and
 c.`reg-id`=r.id and
 c.`dpto-id`=dpto.id and
 c.`muni-id`=m.id and
 c.`org-id`=o.id  and
 c.id=$var");

while($row=mysql_fetch_array($result))
		{
    $oid=$row['oid'];
    $aid=$row['aid'];
		
?>
<div id="content">
  <div id="breadCrumb"></div>
  <?php if(($_GET['m'])==1){?>
      <h2 id="pageName" style=" text-transform:uppercase">Capa Deshabilitada</h2>        
  <br>
  <div style=" margin-left: 40px;  padding: 5px 5px 5px 5px; background-color: #eee; width: 610px; border: 1px #ccc dotted">
  <strong class="titulo" >Razon </strong><br><br><div  class="cuerpo" ><?php echo $mensaje;?></div>
  
  <p><strong  class="titulo">Procedencia</strong><br><div class="cuerpo"><?php echo $row['org'];?>    <button id="ver-org">+ info</button><br> 
            <?php 
            if (($row['aid']!=0)){
                $rowarea=existe("id", "area", $aid);
                echo  $rowarea['nombre'].'    <button id="ver-area">+ info</button>';} ?></div>
  
  </div>         
  <br>
  <?php }?>
  <h2 id="pageName" style=" text-transform:uppercase">Informacion completa acerca de la capa <?php echo $row['titulo']; ?></h2>
  <br>  <div class="feature">
      
      <table width="600" border="0">
      <tr>
        <td width="434">
	  <p><strong  class="titulo">Titulo</strong><br><div class="cuerpo" style=" text-transform:uppercase"><?php echo $row['titulo']; ?></div></p>
          <p><strong  class="titulo">Descripción</strong><br><div class="cuerpo " style=" text-align:  justify"><?php echo $row['descripcionautor']; ?></div></p>
          <p><strong  class="titulo">Comentario</strong><br><div class="cuerpo" style=" text-align:  justify"><?php echo $row['comentariowm']; ?></div></p>
          <p><strong  class="titulo">Metadatos</strong><br><div class="cuerpo" style=" text-align:  justify"><?php echo $row['metadatos']; ?></div></p>
          <p><strong  class="titulo">Tipo</strong><br><div class="cuerpo"><?php echo $row['tipo'].'/'.$row['subtipo']; ?></div></p> 
          <p><strong  class="titulo">Categorias</strong><br><div class="cuerpo"><?php echo $row['c1'].'/'.$row['c2']; ?></div></p>
          <p><strong  class="titulo">Ubicacion</strong><br><div class="cuerpo"><?php echo $row['pa'].' '.$row['pro'].' '.$row['reg'].' '.$row['de'].' '.$row['mu']; ?></div></p>
          
          <?php if(($_GET['m'])==1){           echo '<!--';?>
          <p><strong  class="titulo">Procedencia</strong><br><div class="cuerpo"><?php echo $row['org'];?>    <button id="ver-org">+ info</button><br> 
                                                                                <?php 
                                                                                if (($row['aid']!=0)){
                                                                                    $rowarea=existe("id", "area", $aid);
                                                                                    echo  $rowarea['nombre'].'    <button id="ver-area">+ info</button></div></p>';} ?><br></br></div>
          <strong><a href="<?php echo $row['folder'].''.$row['f']; ?>"> Descargar Capa De <?php echo $row['titulo']; ?></a> </strong> <br></br>
          <?php  echo '-->';}
          else{?>
              <p><strong  class="titulo">Procedencia</strong><br><div class="cuerpo"><?php echo $row['org'];?>    <button id="ver-org">+ info</button><br> 
                                                                                <?php 
                                                                                if (($row['aid']!=0)){
                                                                                    $rowarea=existe("id", "area", $aid);
                                                                                    echo  $rowarea['nombre'].'    <button id="ver-area">+ info</button></div></p>';} ?><br></br></div>
             <strong><a href="<?php echo $row['folder'].''.$row['f']; ?>"> Descargar Capa De <?php echo $row['titulo']; ?></a> </strong> <br></br> 
          <?php } ?>
          <img src="<?php echo $row['folder'].''.$row['imagen']; ?>"  width="400" height="350"/><br>
        </td>
        </tr>
    </table>
    
    <p>
     
  
       
       
      <br>
    </p>
 

    <div class="demo">
        <div id="dialog-message-org" title="Información de la Organización">
            <?php
                $result=mysql_query("select o.nombre as onombre ,o.email as omail ,o.telefono as otel,o.responsable as ore  from samptyt.organizacion as o WHERE o.id=$oid");
                 while($rowconcla=mysql_fetch_array($result))
                            {
                               echo '<b>NOMBRE</b><br>'.$rowconcla['onombre'].
                                    '<br><br><b>E-MAIL</b><br>
                                        <a href="mailto:'.$rowconcla['omail'].'">'.$rowconcla['omail'].
                                    '</a><br><br><b>TELEFONO</b><br>'.$rowconcla['otel'].
                                    '<br><br><b>RESPONSABLE</b><br>'.$rowconcla['ore'];

                            }
            ?>  
        </div>    
        <div id="dialog-message-area" title="Información del Area">
          
             <?php
                $result=mysql_query("select a.nombre as anombre,a.email as amail,a.telefono as atel,a.responsable as are,a.descripcion as ades from samptyt.area as a WHERE a.id=$aid");
                 while($rowconcla=mysql_fetch_array($result))
                            {
                                echo '<b>NOMBRE</b><br>'.$rowconcla['anombre'].
                             '<br><br><b>E-MAIL</b><br>
                                 <a href="mailto:'.$rowconcla['amail'].'">'.$rowconcla['amail'].
                           '</a><br><br><b>TELEFONO</b><br>'.$rowconcla['atel'].
                             '<br><br><b>RESPONSABLE</b><br>'.$rowconcla['are'].
                             '<br><br><b>DESCRIPCION</b><br>'.$rowconcla['ades'];

                            }
            ?>  
        </div>         
    </div>
    <p>
      <?php 
	  }
	  }


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
    </p>
    <p>&nbsp;</p>
  </div>
  <div class="story">
    <h3>&nbsp;</h3>
  </div>
  <div class="story"></div>
</div>
<!--end content -->
<div id="menuderecha">
     	<?php
	require_once("menuderecha.php");
	?> 
</div>
<!--fin menuderecha -->
<div id="footer">
     	<?php
	require_once("footer.php");

	?> 
</div>

<br />
</div>
</body>
</html>